home *** CD-ROM | disk | FTP | other *** search
/ PC World 2007 December / PCWorld_2007-12_cd.bin / domacnost a kancelar / autoit / autoit-v3-setup.exe / Examples / Helpfile / GUICtrlRecvMsg.au3 < prev    next >
Text File  |  2007-09-08  |  706b  |  27 lines

  1. #include <GUIConstantsEx.au3>
  2. #include <EditConstants.au3>
  3.  
  4. GUICreate("My GUI")  ; will create a dialog box that when displayed is centered
  5.  
  6. $nEdit = GUICtrlCreateEdit ("line 0", 10,10)
  7. GUICtrlCreateButton ("Ok", 20,200,50)
  8.  
  9. GUISetState ()
  10.  
  11. For $n=1 To 5
  12. GUICtrlSetData ($nEdit, @CRLF & "line "& $n)
  13. Next
  14.  
  15.  
  16. ; Run the GUI until the dialog is closed
  17. Do
  18.     $msg = GUIGetMsg()
  19.     If $msg >0 Then
  20.         $a=GUICtrlRecvMsg($nEdit, $EM_GETSEL)
  21.         GUICtrlSetState($nEdit,$GUI_FOCUS)    ; set focus back on edit control
  22.  
  23. ; will display the wParam and lParam values return by the control
  24.         MsgBox(0,"Current selection",StringFormat("start=%d end=%d", $a[0], $a[1]))
  25.     EndIf
  26. Until $msg = $GUI_EVENT_CLOSE
  27.